package cate.common.table.activity.foodgod.sheet;

import cate.common.table.ESheet;
import cate.common.table.activity.foodgod.row.FoodGodRewardRow;

import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;

public class FoodGodRewardSheet extends ESheet<FoodGodRewardRow> {
    @Override
    public String getSheetName() {
        return "奖励";
    }

    public List<FoodGodRewardRow> getRows(int rewardGroup) {
        return getList().stream().filter(e -> e.rewardGroup == rewardGroup).collect(Collectors.toList());
    }

    public FoodGodRewardRow getMaxRow(int rewardGroup) {
        return getList().stream().filter(e -> e.rewardGroup == rewardGroup)
                .max(Comparator.comparingInt(e -> e.cost)).orElse(null);
    }
}
